<template>
  <div class="container">
    <Category title="美食">
      <slot>
        <img slot="center" :src="img" alt="" />
        <a slot="footer" href="https://www.bugdr.cn">博客</a>
      </slot>
    </Category>
    <Category title="游戏">
      <ul slot="center">
        <li v-for="(item, index) in games" :key="index">{{ item }}</li>
      </ul>
      <div class="foot" slot="footer">
        <a href="https://www.bugdr.cn">单机游戏</a>
        <a href="https://www.bugdr.cn">网络游戏</a>
      </div>
    </Category>
    <Category title="电影">
      <video
        slot="center"
        controls
        src="https://www.bilibili.com/bangumi/play/ep413573"
      ></video>
      <!-- 另外一种插槽的声明v-slot：xxx，必须配合template使用 -->
      <template v-slot:footer>
        <div class="foot">
          <a href="https://www.bugdr.cn">经典</a>
          <a href="https://www.bugdr.cn">热门</a>
          <a href="https://www.bugdr.cn">推荐</a>
        </div>
        <h4>欢迎前来观影</h4>
      </template>
    </Category>
  </div>
</template>

<script>
import Category from "@/components/Category";

export default {
  name: "App",
  data() {
    return {
      games: ["使命召唤", "英雄联盟", "穿越火线", "王者荣耀"],
      foods: ["米饭", "烤肉", "火锅", "香菜"],
      films: ["《百年孤独》", "《肖申克的救赎》", "《死神》", "《赌神》"],
      img: "https://www.bugdr.cn/portal/image/1618322043263_831648456303968256.png",
    };
  },
  components: {
    Category,
  },
  mounted() {},
  methods: {},
};
</script>

<style scoped>
.container,
.foot {
  display: flex;
  justify-content: space-around;
}
video {
  width: 100%;
}
h4 {
  text-align: center;
}
</style>
